﻿/**
 * 
 */
function ckphone() {
	
	var phone = document.getElementById("phone").value;
	
	var reg = /^(13[0-9]|14[5|7]|15[0|1|2|3|5|6|7|8|9]|17[0|1|2|3|5|6|7|8|9]|18[0|1|2|3|5|6|7|8|9])\d{8}$/;
	if (!reg.test(phone)) {
		document.getElementById("spphone").innerHTML = "请输入正确的手机号";
		return false;
	}
	if (reg.test(phone)) {
		document.getElementById("spphone").innerHTML = "√";
		
	}
	 return true;
}

function ckaddress() {
	
	
	var str = document.getElementById('address').value.trim();
	
	if (str.length == 0) {
		document.getElementById("spaddress").innerHTML = "地址栏不能为空";
		return false;
	}
	if (str.length != 0) {
		document.getElementById("spaddress").innerHTML = "√";
		
	}
	return true;
}




function ckemail() {
	var email = document.getElementById("email").value;
	
	reg = /^(\w-*\.*)+@(\w-?)+(\.\w{2,})+$/;
	if (!reg.test(email)) {
		document.getElementById("spemail").innerHTML = "邮箱格式不正确";
		return false;
	}
	if (reg.test(email)) {
		document.getElementById("spemail").innerHTML = "√";
	
	}
	return true;
}

function ckall() {
	var flag=  ckphone() &&ckaddress()&& ckemail();
	
	if(flag==false){
		alert("请正确填写要修改的内容！");
		return flag;
	}
}



















